import * as actionType from "./constants"

const defaultState={
    maindata:[], //首页数据
    index:0, //tabbar的index
}

const reducer=(state= defaultState,action)=>{
    switch(action.type){
        case actionType.CHANGE_MAINDATA:
            return{...state,maindata:action.data}
        case actionType.SET_INDEX:
            return{...state,index:action.data}
        default:
            return state
    }
}

export default reducer